package com.tairanchina.wiki.restful.application;

import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.ServerProperties;

import javax.ws.rs.ApplicationPath;

/**
 * Created by 周靖捷 on 2016/10/1.
 */
@ApplicationPath("/*")
public class MdwikiServerApplication extends ResourceConfig {
    /**
     * Create a new resource configuration without any custom properties or
     * resource and provider classes.
     */
    public MdwikiServerApplication() {
        register(JacksonFeature.class);
        //开启拦截器特性
        property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
        property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);
        packages("com.tairanchina.wiki.restful.resource");
    }
}
